package com.haiwen.boot.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
@ToString
public class comment implements Serializable {
    private Integer commentId;
    private Integer blogId;
    private Integer userId;
    private Integer likes;
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone ="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createtime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone ="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updatetime;
    private Integer state;
    private String content;
    private List<commentReply> commentReplyList;
    public comment(){}
    public comment(Integer blogId, Integer userId,
                   @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
                   @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date createtime,
                   @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
                   @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date updatetime,
                   String content) {
        this.blogId = blogId;
        this.userId = userId;
        this.createtime = createtime;
        this.updatetime = updatetime;
        this.content = content;
    }
}
